﻿@model QDT.Core.Members.User
@{
    ViewBag.Title = "用户账户设置";
}
<script type="text/javascript" src="@Url.Content("~/Content/Default/JS/jquery.validate.js")"> </script>
<script type="text/javascript" src="@Url.Content("~/Content/Default/JS/messages_zh.js")"> </script>
<script type="text/javascript">
    $().ready(function () {
        $('form').validate({
            rules: {
                ConfirmPassword: {
                    equalTo: "#Password"
                }
            },
            messages: {
                ConfirmPassword: "<span style='padding-left:10px;color:#e0524b;'>两次密码不相同</span>"
            }
        });
        $("#Safe_Center").css("background", "#e0524b");
        $("#Safe_Center i,#Safe_Center span").css("color", "white");
        $("#Safe_Center .san-jiaoxing").css("display", "block");
    });

    function checkform() {
        if ($("#PasswordOld").val() == "") {
            $("#check-old-pwd").html("<span style='padding-left:10px;color:#e0524b;'>当前密码不能为空</span>");
            return false;
        } else if ($("#Password").val() == "") {
            $("#check-new-pwd").html("<span style='padding-left:10px;color:#e0524b;'>新密码不能为空</span>");
            return false;
        } else {
            return true;
        }
    }

    $(function () {
        $("#PasswordOld").blur(function () {
            if ($(this).val() == "") {
                $("#check-old-pwd").html("<span style='padding-left:10px;color:#e0524b;'>当前密码不能为空</span>");
            } else {
                $("#check-old-pwd").html("");
            }
        });
        $("#Password").blur(function () {
            if ($(this).val() == "") {
                $("#check-new-pwd").html("<span style='padding-left:10px;color:#e0524b;'>新密码不能为空</span>");
            } else {
                $("#check-new-pwd").html("");
            }
        });
    });
</script>
<style type="text/css">
    .ui-body
    {
        padding: 0;
        background: white;
    }
    .ui-grid-20
    {
        width: 778px;
        margin-left: -20px;
    }
</style>
@Html.Action("_UserBanner")
<div class="ui-body">
    <div class="ui-inner">
        <div class="ui-grid-row">
            @Html.Action("UserMenu", new { route = MenuRoute.SafeCenter })
            <div class="ui-grid-20">
                <div class="ui-box">
                    <div class="ui-box-hd">
                        <h1 class="ui-box-title">
                            修改密码</h1>
                    </div>
                    <form class="ui-form" name="" method="post" action="@Url.Action("AccountSetting")" onsubmit="return checkform()">
                    <fieldset>
                        <legend>修改密码</legend>
                        <div class="ui-form-item">
                            <label for="" class="ui-label">
                                <span class="ui-form-required">*</span>当前密码
                            </label>
                            <input class="ui-input ui-input-large" type="password" id="PasswordOld" name="PasswordOld" /><span
                                id="check-old-pwd"></span>
                        </div>
                        <div class="ui-form-item">
                            <label for="" class="ui-label">
                                <span class="ui-form-required">*</span>新密码</label>
                            <input class="ui-input ui-input-large" type="password" id="Password" name="Password" /><span
                                id="check-new-pwd"></span>
                        </div>
                        <div class="ui-form-item">
                            <label for="" class="ui-label">
                                <span class="ui-form-required">*</span>确认密码</label>
                            <input class="ui-input ui-input-large" type="password" id="ConfirmPassword" name="ConfirmPassword" />
                        </div>
                        <div class="ui-form-item">
                            <input type="hidden" name="Id" value="@Model.ID"/>
                            <input type="submit" class="ui-button ui-button-orange big" value="确定" />
                            <a href="@Url.Action("SafeCenter")" class="ui-button ui-button-gray big">返回</a>
                        </div>
                    </fieldset>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div style="margin-top: -9px;">@Html.Partial("_BindBottomImage")</div>
